# """
# 该文件用于 标定页面
# """
# import uiautomation as auto
# from page.base_page import BasePage
# from utils.utils_log import loggerCase
# from utils.utils_operation import cal_ratio
# from constant import capture_image_path
#
#
# class CalibrationPage(BasePage):
#     """标定页面"""
#     imagePath = capture_image_path + '/calibration'
#
#     def __init__(self):
#         super(CalibrationPage, self).__init__()
#     # 标定/白平衡成功下一步按钮
#     __success_next_button = auto.ButtonControl(Name="Next")
#
#     # 标定切换框
#     __calibration_text = auto.TextControl(Name="Calibration")
#
#     # 标定失败
#     __redo_calibration = auto.ButtonControl(Name="Redo calibration")
#
#     # 开始标定/白平衡按钮按钮
#     __click_to_start_button = imagePath + "/start_button.png"
#
#     __click_system_calibration_button = imagePath + "/system_calibration_button.png"
#
#     __click_trak_calibration_button = imagePath + "/trak_calibration_button.png"
#
#     def click_calibration_start_button(self, max_wait_time=1):
#         """点击开始标定按钮"""
#         loggerCase.info("开始标定")
#         self.click_by_pyautogui(CalibrationPage.__click_to_start_button, max_wait_time=max_wait_time)
#
#     def click_system_button(self, max_wait_time=1):
#         """切换系统标定模式"""
#         loggerCase.info("切换系统标定")
#         self.click_by_pyautogui(CalibrationPage.__click_system_calibration_button, max_wait_time=max_wait_time)
#
#     def click_trak_cal_button(self, max_wait_time=1):
#         """切换跟踪仪标定模式"""
#         loggerCase.info("切换跟踪仪标定")
#         self.click_by_pyautogui(CalibrationPage.__click_trak_calibration_button, max_wait_time=max_wait_time)
#
#     def click_next_button(self, max_wait_time=2):
#         """点击下一步"""
#         loggerCase.info("点击下一步")
#         self.click(self.__success_next_button, max_wait_time=max_wait_time, is_need_judge=False)
#
#     def click_calibration_text(self):
#         """点击却换为标定"""
#         loggerCase.info("点击切换为标定")
#         self.click(self.__calibration_text)
#
#     def is_has_redo_calibration(self):
#         """
#         是否有重新标定提示
#         """
#
#         loggerCase.info("判断是否有标定失败")
#         return self.judge_element_exist(self.__redo_calibration, max_wait_time=7, max_retries=1, is_need_screen=False,
#                                         is_end=False)
#
#     def is_has_next_button(self):
#         """
#         是否有下一步按钮
#         """
#         loggerCase.info("判断是否有下一步")
#         return self.judge_element_exist(self.__success_next_button, max_wait_time=7, max_retries=3,
#                                         is_need_screen=False, is_end=False)
#
#     def enter_calibration(self, device):
#         """
#         进入标定
#         :param device: 设备类型
#         :return:
#         """
#         loggerCase.info("进入标定")
#         ratio = cal_ratio()
#         if device == 11:
#             self.driver.Click(round(690 * ratio), round(105 * ratio), waitTime=1)
#         elif device == 15:
#             self.driver.Click(round(624 * ratio), round(110 * ratio), waitTime=1)
#         elif device == 12:
#             self.driver.Click(round(690 * ratio), round(105 * ratio), waitTime=1)
